package com.ffzl.cloud.http.response;

import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;

import com.ffzl.cloud.interfacenum.ValueEnum;

public class GrideviewItem implements Parcelable {
    private String nameItem;
    private String nameValue;
    private String valueMess;
    private Drawable bitmapItem;

    public String getNameItem() {
        return nameItem == null ? "" : nameItem;
    }

    public void setNameItem(String nameItem) {
        this.nameItem = nameItem;
    }

    public Drawable getBitmapItem() {
        return bitmapItem;
    }

    public void setBitmapItem(Drawable bitmapItem) {
        this.bitmapItem = bitmapItem;
    }


    public String getNameValue() {
        return nameValue == null ? "" : nameValue;
    }

    public void setNameValue(String nameValue) {
        this.nameValue = nameValue;
    }


    public String getValueMess() {
        return valueMess == null ? "" : valueMess;
    }

    public void setValueMess(String valueMess) {
        this.valueMess = valueMess;
    }

    public GrideviewItem() {
    }


    public GrideviewItem(String nameItem, @ValueEnum String nameValue, String valueMess, Drawable bitmap) {
        this.bitmapItem = bitmap;
        this.nameItem = nameItem;
        this.nameValue = nameValue;
        this.valueMess = valueMess;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.nameItem);
        dest.writeString(this.nameValue);
        dest.writeString(this.valueMess);
        dest.writeParcelable((Parcelable) this.bitmapItem, flags);
    }

    public void readFromParcel(Parcel source) {
        this.nameItem = source.readString();
        this.nameValue = source.readString();
        this.valueMess = source.readString();
        this.bitmapItem = source.readParcelable(Drawable.class.getClassLoader());
    }

    protected GrideviewItem(Parcel in) {
        this.nameItem = in.readString();
        this.nameValue = in.readString();
        this.valueMess = in.readString();
        this.bitmapItem = in.readParcelable(Drawable.class.getClassLoader());
    }

    public static final Creator<GrideviewItem> CREATOR = new Creator<GrideviewItem>() {
        @Override
        public GrideviewItem createFromParcel(Parcel source) {
            return new GrideviewItem(source);
        }

        @Override
        public GrideviewItem[] newArray(int size) {
            return new GrideviewItem[size];
        }
    };
}
